<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>


        <style>

            .box{
                width: 600px;
                height: 600px;
                border: 1px solid rebeccapurple;
                display: grid;
                grid-template-columns: repeat(3,100px);
                grid-template-rows: repeat(3,100px);
                /* 改变顺序方向 */
                grid-auto-flow: column;

                /* 改变位置
                space-around
                center
                space-between
                space-evenly
                */
                /* justify-content: center;
                align-content: center; */

                /* 简写 */
                place-content: center center;
                
                /* 内容子项 */
                /* justify-items: center;
                align-items: center; */

                /* 简写 */
                place-items: center center;



            }
            .box div{
                border: 1px solid red;
                margin: 5px;
                width: 50px;
                height: 50px;
               
               
            }

        </style>

</head>
<body>
    <div class="box">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div>4</div>
        <div>5</div>
        <div>6</div>
        <div>7</div>
        <div>8</div>
        <div>9</div>

    </div>
    
</body>
</html>